package connector.homework4;

public class Warrior implements Fightable {
    private int experience;
    private int blood;

    public Warrior() {
    }

    public Warrior(int experience, int blood) {
        this.experience = experience;
        this.blood = blood;
    }

    public int getExperience() {
        return experience;
    }

    public void setExperience(int experience) {
        this.experience = experience;
    }

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }

    @Override
    public void win() {
        int reulst=this.getExperience()+5;
        this.setExperience(reulst);
    }

    @Override
    public int injure(int x) {
        if (this.getBlood()<MAX) {
            System.out.println("血液量不足");
        }
        int reulst =this.getBlood()-x;
        setBlood(reulst);
        return this.getBlood();
    }
}